import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:get/get.dart';
import 'package:live_music/components/common/PictureOverview.dart';

class MomentTopSwiperDetail extends StatelessWidget {
  MomentTopSwiperDetail({Key key, this.momentId, this.imageList})
      : super(key: key);
  final int momentId;
  final SwiperController controller = SwiperController();
  final List imageList;

  @override
  Widget build(BuildContext context) {
    if (imageList != null) {
      return (Container(
        height: 500,
        color: Colors.black,
        child: Swiper(
          pagination: new SwiperPagination(
            builder: DotSwiperPaginationBuilder(
                color: Colors.grey[600],
                activeColor: Colors.redAccent,
                size: 5,
                activeSize: 5),
          ),

          // physics: NeverScrollableScrollPhysics(),
          itemCount: imageList.length,
          itemBuilder: (BuildContext context, int index) {
            return InkWell(
                onTap: () {
                  Get.to(PictureOverview(
                      defaultIndex: index, imageItems: imageList));
                },
                child: Hero(
                    tag: 'hero',
                    child: Image(
                        image: NetworkImage(imageList[index].url),
                        fit: BoxFit.fitWidth)));
          },
        ),
      ));
    } else {
      return Container();
    }
  }
}
